package com.ljfiction.book.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by lwj on 2017/9/4
 */


public class IndentDetailAdapter extends FragmentPagerAdapter {
    private List<Fragment> fragments;
    private  String [] tabTitles;
    public IndentDetailAdapter(FragmentManager fm, String[] tabTitles, ArrayList<Fragment> fragments) {
        super(fm);
        this.tabTitles=tabTitles;
        this.fragments=fragments;
    }



    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }

    public CharSequence getPageTitle(int position){

        return tabTitles[position];
    }
}
